package com.lino.design.mediator;


/**
 * @description: 默认SqlSession工厂实现类
 * @author: lingjian
 * @createDate: 2023/1/31 17:19
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private final Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration.connection, configuration.mapperElement);
    }
}
